from t_ch.models import Technology
from bl_g.models import Entry, Category
from pr_j.models import Project
from xfn.models import XFN


def settings(request):
    from django.conf import settings
    return {'SITE_NAME': settings.SITE_NAME,
            'AUTHOR': settings.AUTHOR,
            'PHONE': settings.PHONE,
            'APP_BASE_URL': settings.APP_BASE_URL,
            'EMAIL_ACCOUNT': settings.EMAIL_ACCOUNT,
            'APP_NAME': settings.APP_NAME,
            'TRACKERS': settings.TRACKERS,
            'TWITTER_USERNAME': settings.TWITTER_USERNAME,
            'DISQUS_NAME': settings.DISQUS_NAME,
            'STREET_ADDRESS': settings.STREET_ADDRESS,
            'GOOGLE_SITE_VERIFICATION': getattr(settings, 'GOOGLE_SITE_VERIFICATION', None),
            'GOOGLE_ANALYTICS_URL': getattr(settings, 'GOOGLE_ANALYTICS_URL', None),
            'LIVE': getattr(settings, 'LIVE', False),
            'BL_G_FEED_TITLE': settings.BL_G_FEED_TITLE,
            'BL_G_FEED_URL': settings.BL_G_FEED_URL,
            }
    
def content(request):
    primary_technologies = Technology.objects.filter(primary_technology=True)
    blog_entries = Entry.published_objects.all()[:2]
    featured_projects = Project.objects.filter(featured=True)
    xfns = XFN.objects.all()
    categories = Category.objects.all()
    return {'primary_technologies': primary_technologies,
            'blog_entries': blog_entries,
            'featured_projects': featured_projects,
            'xfns': xfns,
            'categories': categories,}